package cn.changein.framework.enums;


import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;

/**

 * @version V1.0
 * @Description: TODO(共同枚举)
 * @Title: CommonEnum
 * @Package cn.changein.framework.common.enum
 * @date 2021/1/14
 */
public class CommonEnum {

    /**
     * @Description: 会员
     * @Date:2021/1/23 9:40
     * @Param:

     */
    public static class MemberEnum {

        /**
         * @Description: 性别
         * @Date:2021/1/14 14:19
         * @Param:

         */
        public enum SexEnum {
            MAN((short) 1, "男"),
            WOMAN((short) 2, "女"),
            UNKNOWN((short) 3, "未知"),
            ;
            private Short val;
            private String description;

            SexEnum(Short val, String description) {
                this.val = val;
                this.description = description;
            }

            public Short getVal() {
                return val;
            }

            public void setVal(Short val) {
                this.val = val;
            }

            public String getDescription() {
                return description;
            }

            public void setDescription(String description) {
                this.description = description;
            }


            public static Map<Short, String> getSexEnumMap() {
                Map<Short, String> dataMap = new LinkedHashMap<Short, String>();
                for (SexEnum value : SexEnum.values()) {
                    dataMap.put(value.val, value.description);
                }
                return dataMap;
            }
        }

        /**
         * @Description: 身份
         * @Date:2021/1/14 14:19
         * @Param:

         */
        public enum MemberIdentityEnum {
            CELLAR_OWNER((short) 1, "窖主"),
            HOLE_OWNER((short) 2, "洞主"),
            ;
            private Short val;
            private String description;

            MemberIdentityEnum(Short val, String description) {
                this.val = val;
                this.description = description;
            }

            public Short getVal() {
                return val;
            }

            public void setVal(Short val) {
                this.val = val;
            }

            public String getDescription() {
                return description;
            }

            public void setDescription(String description) {
                this.description = description;
            }

            public static Map<Short, String> getMemberIdentityEnumMap() {
                Map<Short, String> dataMap = new LinkedHashMap<Short, String>();
                for (MemberIdentityEnum value : MemberIdentityEnum.values()) {
                    dataMap.put(value.val, value.description);
                }
                return dataMap;
            }
        }

        /**
         * @Description: 审核状态
         * @Date:2021/1/14 14:19
         * @Param:

         */
        public enum ReviewStatusEnum {
            PENDING((short) 1, "待审核"),
            REVIEW_SUCCESS((short) 2, "审核通过"),
            REVIEW_FAIL((short) 3, "审核失败"),
            ;
            private Short val;
            private String description;

            ReviewStatusEnum(Short val, String description) {
                this.val = val;
                this.description = description;
            }

            public Short getVal() {
                return val;
            }

            public void setVal(Short val) {
                this.val = val;
            }

            public String getDescription() {
                return description;
            }

            public void setDescription(String description) {
                this.description = description;
            }

            public static Map<Short, String> getReviewStatusEnumMap() {
                Map<Short, String> dataMap = new LinkedHashMap<Short, String>();
                for (ReviewStatusEnum value : ReviewStatusEnum.values()) {
                    dataMap.put(value.val, value.description);
                }
                return dataMap;
            }
        }

        /**
         * @Description: 状态
         * @Date:2021/1/14 14:19
         * @Param:

         */
        public enum StatusFlagEnum {
            THAW((short) 1, "解冻"),
            FREEZE((short) 2, "冻结"),
            ;
            private Short val;
            private String description;

            StatusFlagEnum(Short val, String description) {
                this.val = val;
                this.description = description;
            }

            public Short getVal() {
                return val;
            }

            public void setVal(Short val) {
                this.val = val;
            }

            public String getDescription() {
                return description;
            }

            public void setDescription(String description) {
                this.description = description;
            }

            public static Map<Short, String> getStatusFlagEnumMap() {
                Map<Short, String> dataMap = new LinkedHashMap<Short, String>();
                for (StatusFlagEnum value : StatusFlagEnum.values()) {
                    dataMap.put(value.val, value.description);
                }
                return dataMap;
            }
        }

        /**
         * @Description: 会员来源
         * @Date:2021/1/14 14:19
         * @Param:

         */
        public enum MemberOriginEnum {
            ANDROID((short) 1, "Android"),
            IOS((short) 2, "ios"),
            APPLETS((short) 3, "小程序"),
            H5((short) 4, "h5"),
            ;
            private Short val;
            private String description;

            MemberOriginEnum(Short val, String description) {
                this.val = val;
                this.description = description;
            }

            public Short getVal() {
                return val;
            }

            public void setVal(Short val) {
                this.val = val;
            }

            public String getDescription() {
                return description;
            }

            public void setDescription(String description) {
                this.description = description;
            }

            public static Map<Short, String> getMemberOriginEnumMap() {
                Map<Short, String> dataMap = new LinkedHashMap<Short, String>();
                for (MemberOriginEnum value : MemberOriginEnum.values()) {
                    dataMap.put(value.val, value.description);
                }
                return dataMap;
            }
        }
    }

    /**
     * @Description: 发送验证码的类型
     * @Date:2021/1/23 9:44
     * @Param:

     */
    public enum SmsCodeType {

        REGISTER_TYPE_CODE((short) 1, "注册类型验证码", "REGISTER_TYPE_CODE", "REGISTER:TYPE:CODE:"),
        LOGIN_TYPE_CODE((short) 2, "登录类型验证码", "LOGIN_TYPE_CODE", "LOGIN:TYPE:CODE:"),
        ;
        private Short val; //值
        private String description; //描述
        private String typeCode; //类型代码
        private String typeCodeCache; //类型代码缓存

        SmsCodeType(Short val, String description, String typeCode, String typeCodeCache) {
            this.val = val;
            this.description = description;
            this.typeCode = typeCode;
            this.typeCodeCache = typeCodeCache;
        }

        public Short getVal() {
            return val;
        }

        public void setVal(Short val) {
            this.val = val;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public String getTypeCode() {
            return typeCode;
        }

        public void setTypeCode(String typeCode) {
            this.typeCode = typeCode;
        }

        public String getTypeCodeCache() {
            return typeCodeCache;
        }

        public void setTypeCodeCache(String typeCodeCache) {
            this.typeCodeCache = typeCodeCache;
        }

        /**
         * @Description: 获取验证码类型
         * @Date:2021/1/23 9:46
         * @Param: [opType]

         */
        public static SmsCodeType geSmsCodeType(Short opType) {
            for (SmsCodeType codeType : SmsCodeType.values()) {
                Short val = codeType.getVal();
                if (Objects.equals(val, opType)) return codeType;

            }
            return null;
        }
    }

    /**
     * @Description: 简历
     * @Date:2021/1/27 16:01
     * @Param:

     */
    public static class MemberResumeEnum {

        /**
         * @Description: 性别
         * @Date:2021/1/14 14:19
         * @Param:

         */
        public enum SexEnum {
            MAN((short) 1, "男"),
            WOMAN((short) 2, "女"),
            UNKNOWN((short) 3, "未知"),
            ;
            private Short val;
            private String description;

            SexEnum(Short val, String description) {
                this.val = val;
                this.description = description;
            }

            public Short getVal() {
                return val;
            }

            public void setVal(Short val) {
                this.val = val;
            }

            public String getDescription() {
                return description;
            }

            public void setDescription(String description) {
                this.description = description;
            }


            public static Map<Short, String> getSexEnumMap() {
                Map<Short, String> dataMap = new LinkedHashMap<Short, String>();
                for (SexEnum value : SexEnum.values()) {
                    dataMap.put(value.val, value.description);
                }
                return dataMap;
            }
        }

        /**
         * @Description: 状态
         * @Date:2021/1/14 14:19
         * @Param:

         */
        public enum StatusFlagEnum {
            THAW((short) 1, "启用"),
            FREEZE((short) 2, "禁用"),
            ;
            private Short val;
            private String description;

            StatusFlagEnum(Short val, String description) {
                this.val = val;
                this.description = description;
            }

            public Short getVal() {
                return val;
            }

            public void setVal(Short val) {
                this.val = val;
            }

            public String getDescription() {
                return description;
            }

            public void setDescription(String description) {
                this.description = description;
            }

            public static Map<Short, String> getStatusFlagEnumMap() {
                Map<Short, String> dataMap = new LinkedHashMap<Short, String>();
                for (StatusFlagEnum value : StatusFlagEnum.values()) {
                    dataMap.put(value.val, value.description);
                }
                return dataMap;
            }
        }

    }

    /**
     * @Description: 首页轮播图
     * @Date:2021/2/26 10:20
     * @Param:

     */
    public static class HomePageEnum {

        /**
         * @Description: 状态
         * @Date:2021/1/14 14:19
         * @Param:

         */
        public enum StatusEnum {
            THAW((short) 1, "启用"),
            FREEZE((short) 2, "禁用"),
            ;
            private Short val;
            private String description;

            StatusEnum(Short val, String description) {
                this.val = val;
                this.description = description;
            }

            public Short getVal() {
                return val;
            }

            public void setVal(Short val) {
                this.val = val;
            }

            public String getDescription() {
                return description;
            }

            public void setDescription(String description) {
                this.description = description;
            }

            public static Map<Short, String> getStatusEnumMap() {
                Map<Short, String> dataMap = new LinkedHashMap<Short, String>();
                for (HomePageEnum.StatusEnum value : HomePageEnum.StatusEnum.values()) {
                    dataMap.put(value.val, value.description);
                }
                return dataMap;
            }
        }

        /**
         * @Description: 状态
         * @Date:2021/1/14 14:19
         * @Param:

         */
        public enum TypeEnum {

            POLICY_INQUIRY((short) 1, "政策查询"),
            ;
            private Short val;
            private String description;

            TypeEnum(Short val, String description) {
                this.val = val;
                this.description = description;
            }

            public Short getVal() {
                return val;
            }

            public void setVal(Short val) {
                this.val = val;
            }

            public String getDescription() {
                return description;
            }

            public void setDescription(String description) {
                this.description = description;
            }

            public static Map<Short, String> getTypeEnumMap() {
                Map<Short, String> dataMap = new LinkedHashMap<Short, String>();
                for (HomePageEnum.TypeEnum value : HomePageEnum.TypeEnum.values()) {
                    dataMap.put(value.val, value.description);
                }
                return dataMap;
            }
        }
    }
}